# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=5

inherit cmake-utils virtualx pax-utils git-r3 cmake-multilib multilib

DESCRIPTION="VDPAU driver with VA-API/OpenGL backend."
HOMEPAGE="https://github.com/i-rinat/libvdpau-va-gl/"
EGIT_REPO_URI="https://github.com/i-rinat/libvdpau-va-gl.git"

LICENSE="LGPL-3"
SLOT="0"
IUSE="video_cards_i965"

RDEPEND="
	dev-libs/glib:2
	media-libs/glu
	virtual/ffmpeg
	virtual/opengl
	x11-libs/libva[X]
	x11-libs/libvdpau
	x11-libs/libX11
	x11-libs/libXext
"
DEPEND="${RDEPEND}"

DOCS=(ChangeLog README.md)

multilib_src_compile() {
	cmake-utils_src_compile
}

src_compile() {
	multilib_parallel_foreach_abi multilib_src_compile
}

multilib_src_install() {
    cmake-utils_src_install
	if use video_cards_i965 ; then
		dosym vdpau/libvdpau_va_gl.so /usr/$(get_libdir)/libvdpau_i965.so
    fi
}

src_install() {
    multilib_parallel_foreach_abi multilib_src_install
}
